<?php
App::uses('StringUtils', 'Lib'); 
class Curso extends AppModel {
    public $name = 'Curso';
	
	public $validate = array(
        'titulo' => array(
            'rule' => 'notEmpty'
        ),
        'descripcion' => array(
            'rule' => 'notEmpty'
        )
    );
	
	function afterFind($results) {
		foreach ($results as $key => $val) {
			if (isset($val['Curso']['titulo'])) {
				$results[$key]['Curso']['pretty_titulo'] = StringUtils::stripSpecialChars($val['Curso']['titulo'], true);
			}
		}
		return $results;
	}
}